      SUBROUTINE YRMODA(TIME,IMN,IDY,IHOUR,IMINS,ISECS)
      IMPLICIT REAL*8 (A-H,O-Z)
C
      COMMON/IMAIN1/ IDATE,LSAVE,INOPT,IPLOT,NUMEQS,IPLTPE,IORB,ITAPE
C
      DIMENSION JULDAY(12)
      DATA JULDAY /0,31,59,90,120,151,181,212,243,273,304,334/
C
      IYR=IDATE/10000
      IDY=TIME/8.64D4+1.0D0
      ISECS=TIME-FLOAT(IDY-1)*8.64D4
      IHOUR=ISECS/3600
      IMINS=(ISECS-IHOUR*3600)/60
      ISECS=MOD(ISECS,60)
    1 ID=0
      IXDAY=0
      IF (MOD(IYR,4) .EQ. 0  .AND.  IDY .GE. 60)  ID=1
      IF (IDY .EQ. 60  .AND.  ID .EQ. 1)  IXDAY=1
      IDY=IDY-ID
      DO 2 J=1,12
      IF (IDY .LE. JULDAY(J))  GO TO 3
    2 IMN=J
      IF (IDY .LE. 365)  GO TO 3
      IYR=IYR+1
      IDY=IDY-365
      GO TO 1
    3 IDY=IDY-JULDAY(IMN)+IXDAY
      RETURN
      END
